package util.general;
import java.util.HashMap;
import java.util.Map;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.platform.win32.WinDef.DWORD;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIFunctionMapper;
import com.sun.jna.win32.W32APITypeMapper;
/**
 * 
 * @author ThaiBaoDoan
 *
 */
public interface Kernel32 extends StdCallLibrary {
	public static int FILE_ATTRIBUTE_ARCHIVE  = 20 ;
	public static int FILE_ATTRIBUTE_COMPRESSED = 2048 ;
	public static int FILE_ATTRIBUTE_DEVICE = 64 ;
	public static int FILE_ATTRIBUTE_DIRECTORY = 16;
	public static int FILE_ATTRIBUTE_ENCRYPTED = 16384;
	public static int FILE_ATTRIBUTE_HIDDEN = 2;
	public static int FILE_ATTRIBUTE_NORMAL = 128;
	public static int FILE_ATTRIBUTE_READONLY = 1;
	public static int FILE_ATTRIBUTE_VIRTUAL = 65536;
	public static int FILE_ATTRIBUTE_OS = 4;
    final static Map<String, Object> WIN32API_OPTIONS = new HashMap<String, Object>() {

        private static final long serialVersionUID = 1L;

        {
            put(Library.OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.UNICODE);
            put(Library.OPTION_TYPE_MAPPER, W32APITypeMapper.UNICODE);
        }
    };

    public Kernel32 INSTANCE = (Kernel32) Native.loadLibrary("Kernel32", Kernel32.class, WIN32API_OPTIONS);
 
    public boolean GetVolumeInformation(
            String lpRootPathName,
            char[] lpVolumeNameBuffer,
            DWORD nVolumeNameSize,
            IntByReference lpVolumeSerialNumber,
            IntByReference lpMaximumComponentLength,
            IntByReference lpFileSystemFlags,
            char[] lpFileSystemNameBuffer,
            DWORD nFileSystemNameSize
            );
    int GetDriveType(String rootPathName);
    
    int  GetFileAttributes(
      		 String lpFileName
       );
    public int GetLastError();
    //Enum for file attributes
     
}